<!DOCTYPE html>
<html lang="zh-CN" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>个人资料 - 智能营养管理系统</title>
    <style>
        /* 基本样式 */
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }
        
        body {
            font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
            line-height: 1.6;
            color: #333;
            background-color: #f8f9fa;
        }
        
        .container {
            max-width: 1000px;
            margin: 0 auto;
            padding: 0 15px;
        }
        
        .navbar {
            background-color: #007bff;
            color: white;
            padding: 1rem 0;
            margin-bottom: 2rem;
        }
        
        .navbar-brand {
            font-size: 1.5rem;
            font-weight: bold;
            color: white;
            text-decoration: none;
        }
        
        .page-header {
            background: linear-gradient(135deg, #6f42c1 0%, #5a32a3 100%);
            color: white;
            padding: 2rem 0;
            border-radius: 10px;
            margin-bottom: 2rem;
            text-align: center;
        }
        
        .nav-tabs {
            display: flex;
            border-bottom: 1px solid #dee2e6;
            margin-bottom: 2rem;
            background: white;
            border-radius: 10px 10px 0 0;
            overflow: hidden;
        }
        
        .nav-tab {
            flex: 1;
            padding: 1rem;
            background-color: #f8f9fa;
            border: none;
            cursor: pointer;
            transition: all 0.3s ease;
            text-align: center;
            font-weight: 500;
        }
        
        .nav-tab.active {
            background-color: white;
            color: #007bff;
            font-weight: bold;
        }
        
        .nav-tab:hover {
            background-color: #e9ecef;
        }
        
        .card {
            background: white;
            border-radius: 10px;
            box-shadow: 0 2px 10px rgba(0,0,0,0.1);
            padding: 2rem;
            margin-bottom: 2rem;
        }
        
        .form-group {
            margin-bottom: 1.5rem;
        }
        
        .form-label {
            display: block;
            margin-bottom: 0.5rem;
            font-weight: 500;
            color: #495057;
        }
        
        .form-control {
            width: 100%;
            padding: 0.75rem;
            border: 1px solid #ced4da;
            border-radius: 5px;
            font-size: 1rem;
            transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
        }
        
        .form-control:focus {
            border-color: #007bff;
            outline: 0;
            box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
        }
        
        .form-control:disabled {
            background-color: #e9ecef;
            opacity: 1;
        }
        
        .form-text {
            font-size: 0.875rem;
            color: #6c757d;
            margin-top: 0.25rem;
        }
        
        .row {
            display: flex;
            flex-wrap: wrap;
            margin: -15px;
        }
        
        .col-md-6 {
            flex: 0 0 50%;
            max-width: 50%;
            padding: 15px;
        }
        
        .col-md-12 {
            flex: 0 0 100%;
            max-width: 100%;
            padding: 15px;
        }
        
        .btn {
            display: inline-block;
            padding: 0.75rem 1.5rem;
            border: none;
            border-radius: 5px;
            text-decoration: none;
            font-weight: 500;
            cursor: pointer;
            transition: all 0.3s ease;
            text-align: center;
            font-size: 1rem;
        }
        
        .btn-primary {
            background-color: #007bff;
            color: white;
        }
        
        .btn-primary:hover {
            background-color: #0056b3;
        }
        
        .btn-secondary {
            background-color: #6c757d;
            color: white;
        }
        
        .btn-secondary:hover {
            background-color: #545b62;
        }
        
        .health-metrics {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
            gap: 1rem;
            margin-top: 2rem;
        }
        
        .metric-card {
            background: #f8f9fa;
            padding: 1.5rem;
            border-radius: 10px;
            text-align: center;
            border: 1px solid #dee2e6;
        }
        
        .metric-title {
            font-size: 0.9rem;
            color: #6c757d;
            margin-bottom: 0.5rem;
        }
        
        .metric-value {
            font-size: 1.5rem;
            font-weight: bold;
            color: #007bff;
        }
        
        .metric-status {
            font-size: 0.8rem;
            margin-top: 0.5rem;
            padding: 0.25rem 0.5rem;
            border-radius: 15px;
            background-color: #28a745;
            color: white;
        }
        
        .alert {
            padding: 1rem;
            border-radius: 5px;
            margin-bottom: 1rem;
        }
        
        .alert-success {
            background-color: #d4edda;
            border: 1px solid #c3e6cb;
            color: #155724;
        }
        
        .alert-danger {
            background-color: #f8d7da;
            border: 1px solid #f5c6cb;
            color: #721c24;
        }
        
        .text-center {
            text-align: center;
        }
        
        .text-muted {
            color: #6c757d;
        }
        
        @media (max-width: 768px) {
            .col-md-6, .col-md-12 {
                flex: 0 0 100%;
                max-width: 100%;
            }
            
            .nav-tabs {
                flex-direction: column;
            }
        }
    </style>
</head>
<body>
    <!-- 导航栏 -->
    <nav class="navbar">
        <div class="container">
            <a class="navbar-brand" href="/">🍃 智能营养管理系统</a>
        </div>
    </nav>
    
    <div class="container">
        <!-- 页面标题 -->
        <div class="page-header">
            <h1>👤 个人资料</h1>
            <p>管理您的个人信息和健康目标</p>
        </div>
        
        <!-- 导航标签 -->
        <div class="nav-tabs">
            <button class="nav-tab active" onclick="showTab('profile')">1. 仪表盘</button>
            <button class="nav-tab" onclick="showTab('info')">2. 个人资料</button>
        </div>
        
        <!-- 个人资料表单 -->
        <div id="profile-tab" class="card">
            <h3>📋 基本信息</h3>

            <form action="/profile" method="post">
                <div class="row">
                    <div class="col-md-6">
                        <div class="form-group">
                            <label class="form-label">用户名</label>
                            <input type="text" class="form-control" value="admin" disabled>
                            <div class="form-text">用户名不可修改</div>
                        </div>
                    </div>

                    <div class="col-md-6">
                        <div class="form-group">
                            <label class="form-label">邮箱</label>
                            <input type="email" class="form-control" name="email" value="">
                        </div>
                    </div>
                </div>

                <div class="row">
                    <div class="col-md-6">
                        <div class="form-group">
                            <label class="form-label">真实姓名</label>
                            <input type="text" class="form-control" name="realName" value="">
                        </div>
                    </div>

                    <div class="col-md-6">
                        <div class="form-group">
                            <label class="form-label">性别</label>
                            <select class="form-control" name="gender">
                                <option value="其他">其他</option>
                                <option value="男">男</option>
                                <option value="女">女</option>
                            </select>
                        </div>
                    </div>
                </div>

                <div class="row">
                    <div class="col-md-6">
                        <div class="form-group">
                            <label class="form-label">年龄</label>
                            <input type="number" class="form-control" name="age" value="" min="1" max="120">
                            <div class="form-text">岁</div>
                        </div>
                    </div>

                    <div class="col-md-6">
                        <div class="form-group">
                            <label class="form-label">身高</label>
                            <input type="number" class="form-control" name="height" value="" step="0.1" min="50" max="250">
                            <div class="form-text">cm</div>
                        </div>
                    </div>
                </div>

                <div class="row">
                    <div class="col-md-6">
                        <div class="form-group">
                            <label class="form-label">体重</label>
                            <input type="number" class="form-control" name="weight" value="" step="0.1" min="20" max="300">
                            <div class="form-text">kg</div>
                        </div>
                    </div>

                    <div class="col-md-6">
                        <div class="form-group">
                            <label class="form-label">活动水平</label>
                            <select class="form-control" name="activityLevel">
                                <option value="久坐 (每周1-3次)">久坐 (每周1-3次)</option>
                                <option value="轻度活动 (每周3-5次)">轻度活动 (每周3-5次)</option>
                                <option value="中度活动 (每周3-5次)">中度活动 (每周3-5次)</option>
                                <option value="高度活动 (每周6-7次)">高度活动 (每周6-7次)</option>
                                <option value="极高活动 (每日2次)">极高活动 (每日2次)</option>
                            </select>
                            <div class="form-text">如：久坐、轻度、中度、高强度等</div>
                        </div>
                    </div>
                </div>

                <div class="form-group">
                    <label class="form-label">饮食限制</label>
                    <textarea class="form-control" name="dietaryRestrictions" rows="3"></textarea>
                    <div class="form-text">如：花生、海鲜、乳制品等</div>
                </div>

                <div class="form-group">
                    <label class="form-label">过敏信息</label>
                    <textarea class="form-control" name="allergies" rows="3"></textarea>
                </div>

                <div class="text-center">
                    <button type="submit" class="btn btn-primary">保存更改</button>
                    <a href="/" class="btn btn-secondary">返回首页</a>
                </div>
            </form>
        </div>
        
        <!-- 健康指标 -->
        <div class="card">
            <h3>📊 健康指标</h3>
            
            <div class="health-metrics">
                <div class="metric-card">
                    <div class="metric-title">BMI</div>
                    <div class="metric-value">22.5</div>
                    <div class="metric-status">正常</div>
                </div>

                <div class="metric-card">
                    <div class="metric-title">基础代谢率</div>
                    <div class="metric-value">1402 kcal</div>
                </div>

                <div class="metric-card">
                    <div class="metric-title">总能量消耗</div>
                    <div class="metric-value">2172 kcal</div>
                </div>
            </div>
        </div>

        <!-- 账户信息 -->
        <div class="card">
            <h3>🔐 账户信息</h3>
            <div class="form-group">
                <label class="form-label">注册时间:</label>
                <div>2025-08-18 18:08</div>
            </div>
        </div>
    </div>
    
    <script>
        function showTab(tabName) {
            // 移除所有活动状态
            document.querySelectorAll('.nav-tab').forEach(tab => {
                tab.classList.remove('active');
            });
            
            // 添加当前标签的活动状态
            event.target.classList.add('active');
            
            // 这里可以添加标签切换逻辑
            // 目前只有一个标签页，所以暂时不需要切换
        }
    </script>
</body>
</html>
